package hn.sigit.logic.general;

import hn.sigit.model.hnd.administrative.HND_PermitRuleGroup;
import hn.sigit.model.hnd.administrative.HND_SpatialRule;
import hn.sigit.model.hnd.cadastre.HND_LandUse;
import hn.sigit.model.hnd.cadastre.HND_SpatialZone;
import hn.sigit.model.ladm.spatialunit.LA_Level;

import java.util.List;
import java.util.Map;
import java.util.Set;

import javax.ejb.Local;

@Local
public interface SpatialAnalysisHelper {
	String NAME = "spatialAnalysisHelper";
	

	HND_SpatialZone getSpatialZone();

	void setSpatialZone(HND_SpatialZone spatialZone);

	Double getDistance();

	void setDistance(Double distance);

	HND_PermitRuleGroup getRuleGroup();

	void setRuleGroup(HND_PermitRuleGroup ruleGroup);

	boolean isDoDistance();

	void setDoDistance(boolean doDistance);

	boolean isDoOverlaps();

	void setDoOverlaps(boolean doOverlaps);

	boolean isDoWithin();

	void setDoWithin(boolean doWithin);

	boolean isDoTouches();

	void setDoTouches(boolean doTouches);

	boolean isDoCrosses();

	void setDoCrosses(boolean doCrosses);

	boolean isDoContains();

	void setDoContains(boolean doContains);

	List<SpatialAnalysisResult> getDistanceResults();

	List<SpatialAnalysisResult> getOverlapsResults();

	List<SpatialAnalysisResult> getWithinResults();

	List<SpatialAnalysisResult> getTouchesResults();

	List<SpatialAnalysisResult> getCrossesResults();

	List<SpatialAnalysisResult> getContainsResults();

	void doNewSpatialAnalysis();

	LA_Level getOperand1Level();

	void setOperand1Level(LA_Level operand1Level);

	HND_LandUse getOperand1LandUse();

	void setOperand1LandUse(HND_LandUse operand1LandUse);

	LA_Level getOperand2Level();

	void setOperand2Level(LA_Level operand2Level);

	HND_LandUse getOperand2LandUse();

	void setOperand2LandUse(HND_LandUse operand2LandUse);

	boolean isAnalysisComplete();

	void setAnalysisComplete(boolean analysisComplete);

	Map<HND_SpatialRule, List<SpatialAnalysisResult>> getSpatialRuleToAnalysisMap();

	List<SpatialAnalysisResult> sarListFromRule(HND_SpatialRule spatialRule);

	List<HND_SpatialRule> getRuleGroupRules();
	
	void destroy();
	
	public interface SpatialAnalysisResult {

		HND_SpatialZone getLhsSpatialZone();

		HND_SpatialZone getRhsSpatialZone();

		Set<HND_SpatialRule> getSpatialRuleSet();

		HND_SpatialRule[] getSpatialRuleArray();

		double getDistance();

		String getAnalystObservation();

		void setAnalystObservation(String analystObservation);

		long getSuID();

		String getZoneName();

		String getLocationInCountry();

		String getPrimaryLandUse();

		String getSecondaryLandUse();

		String getLevelName();

	}

}